<script setup>
// 编译器宏函数
const props = defineProps({
  car: String,
  changeCarCb: Function,
})
console.log(props.car)
const emit = defineEmits(['changeCar'])
</script>
<template>
  <div style="width: 300px; height: 200px; border: 10px solid #2d6cc8">
    子组件
    <div>车： {{ car }}</div>
    <button @click="emit('changeCar', '劳斯莱斯')">换车</button>
    <button @click="changeCarCb('宝马X3')">换车(方式2)</button>
  </div>
</template>
